﻿<!--
Majesty of Omega - The next evolution of macro management space strategy

Copyright 2007 André Claaßen

This file is protected by the terms and conditions of the
Microsoft Community License (Ms-CL 1.1), a copy of which should
have been distributed along with this software. If not,
you may find the license information at the following URL:

http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx
-->

<Page
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    xmlns:Majesty_of_Omega_Config="clr-namespace:Majesty_of_Omega.Config;assembly=Majesty_of_Omega_BL"
	xmlns:Majesty_of_Omega_GUI_ValueConverters="clr-namespace:Majesty_of_Omega.GUI.ValueConverters"
	xmlns:Majesty_of_Omega_BL_Game="clr-namespace:Majesty_of_Omega.Model.Game;assembly=Majesty_of_Omega_BL" 
    xmlns:Majesty_of_Omega_Parts="clr-namespace:Majesty_of_Omega.GUI.Pages.Setup.Parts"    
    xmlns:Majesty_of_Omega_Controls="clr-namespace:Majesty_of_Omega.GUI.Controls;assembly="    
    xmlns:GameConfiguration="clr-namespace:Majesty_of_Omega.Logic.GameConfiguration;assembly=Majesty_of_Omega_BL"
	x:Class="Majesty_of_Omega.GUI.Pages.Setup.Step2_RacePickPage"
	x:Name="Page"
    Style="{StaticResource PageSetupStyle}"
	WindowTitle="Customize your Race with Race Picks" >
    <Page.Resources>
        <ObjectDataProvider x:Key="SpreadSheetManagerDS" ObjectType="{x:Type Majesty_of_Omega_Config:SpreadSheetManager}"/>
        <ObjectDataProvider x:Key="GameConfiguratorDS" d:IsDataSource="True" ObjectType="{x:Type GameConfiguration:GameConfigurator}"/>
    </Page.Resources>

    <Grid x:Name="LayoutRoot" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.2*" />
            <ColumnDefinition Width="0.2*" />
            <ColumnDefinition Width="0.2*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="80"/>
            <RowDefinition Height="0.886*" />
            <RowDefinition Height="0.114*"/>
        </Grid.RowDefinitions>

        <!-- Title Section ..................................................................................................... -->
        <Majesty_of_Omega_Parts:SetupTitlePart TitleString="Race Pick" Grid.ColumnSpan="3" />

        <!-- Left Stack with all Race Picks .................................................................................... -->
        <Majesty_of_Omega_Controls:SetupPanelControl Header="Race Picks" x:Name="LeftColumnStackPanel" VerticalAlignment="Stretch" Grid.Row="1" Grid.RowSpan="1">
            <ListBox x:Name="RacePickSettingListBox" IsSynchronizedWithCurrentItem="True" Background="{StaticResource PanelBackgroundBrush}" Width="Auto" Height="Auto"						HorizontalContentAlignment="Left" ScrollViewer.HorizontalScrollBarVisibility="Disabled" VerticalContentAlignment="Stretch" ScrollViewer.CanContentScroll="True"
						SelectionChanged="RacePickSettingListBox_SelectionChanged" 
						ItemsSource="{Binding Path=RaceModifiers.RacePicks, Mode=Default, Source={StaticResource SpreadSheetManagerDS}}"
                        >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Border Width="Auto" Height="Auto" BorderThickness="0,0,0,2">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                    <GradientStop Color="#FFFFFFFF" Offset="0.001"/>
                                    <GradientStop Color="#FF7594B3" Offset="0.999"/>
                                    <GradientStop Color="#FF000000" Offset="0.529"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                            <DockPanel Width="Auto" Height="Auto">
                                <Image Width="64" Height="64" Source="{Binding Path=Picture, Converter={StaticResource UriToImageConverter}, Mode=Default}" />
                                <StackPanel Height="Auto" >
                                    <TextBlock HorizontalAlignment="Left" Text="{Binding Path=Name, Mode=Default}"  Background="{x:Null}" Foreground="#FFFFFFFF"  Margin="0,2,4,2"  FontWeight="Bold"  />
											<TextBlock HorizontalAlignment="Left" Text="{Binding Path=Description, Mode=Default}"  Background="{x:Null}" Foreground="#FF000000"  Margin="0,2,4,2"  TextWrapping="Wrap"  VerticalAlignment="Top"  />
										</StackPanel>
                            </DockPanel>
                        </Border>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Majesty_of_Omega_Controls:SetupPanelControl>

        <!-- Middle Stack with changed Race Picks .............................................................................. -->
        <DockPanel Margin="20,0,20,0" x:Name="MidColumnDockPanel" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="1" Grid.RowSpan="1" >
            <Majesty_of_Omega_Controls:SetupPanelControl DockPanel.Dock="Top" >
                <Majesty_of_Omega_Controls:SetupPanelControl.Header>
                    <DockPanel x:Name="PickOptionsTitle" Width="Auto" Height="Auto">
                        <TextBlock Height="Auto" TextAlignment="Center" Style="{StaticResource TitleTextStyle}" Background="{x:Null}" FontWeight="Bold" Foreground="#FFFFFFFF" Text="PICK OPTIONS FOR..." Margin="0,0,0,0" />
                        <TextBlock Height="Auto" TextAlignment="Center" Style="{StaticResource TitleTextStyle}" FontWeight="Bold" Foreground="#FF000000" Text="{Binding Path=SelectedValue.Name, ElementName=RacePickSettingListBox, Mode=Default}" HorizontalAlignment="Right" Margin="0,0,0,0" DockPanel.Dock="Right" />
                    </DockPanel>
                </Majesty_of_Omega_Controls:SetupPanelControl.Header>
                <ItemsControl x:Name="RacePickItemsControl" ItemsSource="{Binding Path=SelectedValue.Modifiers, ElementName=RacePickSettingListBox, Mode=Default}" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Auto">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <RadioButton IsChecked="{Binding Path=IsSelected, Mode=OneWay}"  Tag="{Binding Path=Name}" Padding="5,0,0,0" Margin="10,10,10,0" GroupName="RacePickGroup" Click="RacePickRadioButton_Click">
                                <DockPanel>
                                    <TextBlock Text="{Binding Path=CostsAsFormattedString}"  Width="Auto" Height="Auto" TextWrapping="Wrap" HorizontalAlignment="Right" DockPanel.Dock="Right" />
										<TextBlock Text="{Binding Path=Description}" Foreground="Black" TextWrapping="Wrap" Width="Auto" Height="Auto" DockPanel.Dock="Bottom" />
										<TextBlock Text="{Binding Path=Name}"  FontWeight="Bold" Foreground="#FFFFFFFF" Width="Auto" Height="Auto" />
										<TextBlock Text="(Race Default)" Margin="10,0,0,0" Visibility="{Binding Path=IsDefault, Converter={StaticResource BooleanToVisibilityConverter}, Mode=Default}"  Width="Auto" Height="Auto" TextWrapping="Wrap"/>
									</DockPanel>
                            </RadioButton>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Majesty_of_Omega_Controls:SetupPanelControl>

            <Majesty_of_Omega_Controls:SetupPanelControl Location="Bottom" Header="Changes on your Race" Margin="0,20,0,0" VerticalAlignment="Stretch" Width="Auto" Height="Auto" DockPanel.Dock="Bottom">
                <DockPanel VerticalAlignment="Stretch" Width="Auto" Height="Auto">
                    <DockPanel Background="{DynamicResource PanelBackgroundBrush}" Height="20" DockPanel.Dock="Bottom" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" LastChildFill="True">
                        <TextBlock Margin="7,0,0,3" VerticalAlignment="Bottom" Width="Auto" DockPanel.Dock="Left" Foreground="#FF0F0F0F" TextWrapping="Wrap"><Run Text="Saldo Pick Points (must be &gt;= 0 ):"/></TextBlock>
                        <TextBlock HorizontalAlignment="Right" Text="{Binding Path=SaldoRacePointsFormatted, Mode=Default}"  Margin="0,0,8,2" VerticalAlignment="Bottom" Width="Auto" Height="Auto" DockPanel.Dock="Right" FontWeight="Bold" TextWrapping="Wrap"/>
					</DockPanel>
                    <ListView IsSynchronizedWithCurrentItem="True"
						Background="{DynamicResource MooE3Brush}"
						HorizontalContentAlignment="Stretch"
						ItemsSource="{Binding Path=ChangedRaceSettings}"
						DockPanel.Dock="Left">
                        <ListView.View>
                            <GridView ColumnHeaderContainerStyle="{StaticResource ListViewHeaderStyle}" >
                                <GridViewColumn Header="Race Pick" DisplayMemberBinding="{Binding Path=RacePickName}" />
                                <GridViewColumn Header="Option" DisplayMemberBinding="{Binding Path=SelectedModifierName}" />
                                <GridViewColumn Header="Game Modifiers" DisplayMemberBinding="{Binding Path=GameplayModifiers}"/>
                                <GridViewColumn Header="Costs" DisplayMemberBinding="{Binding Path=Costs}"/>
                            </GridView>
                        </ListView.View>
                    </ListView>
                </DockPanel>
            </Majesty_of_Omega_Controls:SetupPanelControl>
        </DockPanel>

        <!-- Right Stack with decoration Picture ............................................................................... -->
        <Majesty_of_Omega_Parts:RaceInfoPart x:Name="RaceInfo" Grid.Column="2" Grid.Row="1"  />

        <!-- Navigation with decoration Picture ............................................................................... -->
        <Majesty_of_Omega_Controls:NavigationPanel 
			VerticalAlignment="Bottom" 
			NavigatePageForward="Pages/Setup/Step3_GameSettings.xaml"
			Grid.Row="2"
			Grid.ColumnSpan="3"
            />
    </Grid>
</Page>